
#ifndef __MULTIBOOT_H
#define __MULTIBOOT_H

#include <types.h>

#define MULTIBOOT_FLAG_MEM     0x001
#define MULTIBOOT_FLAG_DEVICE  0x002
#define MULTIBOOT_FLAG_CMDLINE 0x004
#define MULTIBOOT_FLAG_MODS    0x008
#define MULTIBOOT_FLAG_AOUT    0x010
#define MULTIBOOT_FLAG_ELF     0x020
#define MULTIBOOT_FLAG_MMAP    0x040
#define MULTIBOOT_FLAG_CONFIG  0x080
#define MULTIBOOT_FLAG_LOADER  0x100
#define MULTIBOOT_FLAG_APM     0x200
#define MULTIBOOT_FLAG_VBE     0x400

typedef struct multiboot_module
{
  unsigned long mod_start;
  unsigned long mod_end;
  unsigned long string;
  unsigned long reserved;
} multiboot_module_t;


typedef struct multiboot_info
{
        uint32_t flags;                                 
        uint32_t mem_lower;                          
        uint32_t mem_upper;                          
        uint32_t boot_device;              
        uint32_t cmdline;                               
        uint32_t mods_count;                    
        uint32_t mods_addr;                            
        
        // Elf Info
        uint32_t elf_num;
        uint32_t elf_size;
        uint32_t elf_addr;
        uint32_t elf_shndx;

        uint32_t mmap_length;                   
        uint32_t mmap_addr;
        uint32_t drives_length;
        uint32_t drives_addr;
        uint32_t config_table;
        
        uint32_t boot_loader_name;             
        uint32_t apm_table;                            
        uint32_t vbe_control_info;           
        uint32_t vbe_mode_info;               
        uint32_t vbe_mode;                         
        uint32_t vbe_interface_seg;            
        uint32_t vbe_interface_off;            
        uint32_t vbe_interface_len;             
} __attribute__((packed)) multiboot_info_t;


#endif
